package com.xce.product.service.impl;

import com.xce.product.entity.Product;
import com.xce.product.service.ProductService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @ClassName ProductServiceImpl
 * @Description TODO
 * @Author lld
 * @Date 2025/6/25 0:46
 * @Version 1.0
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getProduct(Long productId) {

        Product product = new Product();
        product.setId(productId);
        product.setPrice(BigDecimal.ZERO);
        product.setProductName("苹果0-"+productId);
        product.setNum(2);
        // int i = 1/0;
        // try {
        //     TimeUnit.SECONDS.sleep(2);
        // } catch (InterruptedException e) {
        //     throw new RuntimeException(e);
        // }
        return product;
    }
}
